
declare module Microsoft.Office.WebExtension {

    /** Represents the bindings the app has within the document. */
    export class Bindings {

        /** Gets a Document object that represents the document associated with this set of bindings. */
        document: Document;

        /** Adds a binding to a named item in the document. */
        addFromNamedItemAsync(itemName: string, bindingType: BindingType, options?: { id?: string; asyncContext?: any; }, callback?: (result: AsyncResult) => void);

        /** Displays UI that enables the user to specify a selection to bind to. */
        addFromPromptAsync(bindingType: BindingType, options?: { id?: string; promptText?: string; asyncContext?: any; }, callback?: (result: AsyncResult) => void);

        /** Adds a binding to the current selection in the document. */
        addFromSelectionAsync(bindingType: BindingType, options?: { id?: string; asyncContext?: any; }, callback?: (result: AsyncResult) => void);

        /** Gets all bindings that were previously created. */
        getAllAsync(options?: { asyncContext?: any; }, callback?: (result: AsyncResult) => void);

        /** Gets the specified binding by its identifier. */
        getByIdAsync(id: string, options?: { asyncContext?: any; }, callback?: (result: AsyncResult) => void);

        /** Removes the specified binding. */
        releaseByIdAsync(id: string, options?: { asyncContext?: any; }, callback?: (result: AsyncResult) => void);
    }
}